Øyvind Kolås [Mon, 27 Aug 2018 20:57:54 +0000 (22:57 +0200)]
babl-fish-reference: do some conversions in single precision float
This permits these conversions to go through floating point instead of double
precision when non of the involved format have more than 32bit precision,
this might be determinetal to u32 but is right for u8 and u16 which we rely
most on.
We also disable the missing fast path messages, since now many references;
through internal shortcuts are faster than some long chains, perhaps some
of these reference fast paths should be split out as new categories of fishes.
Øyvind Kolås [Mon, 27 Aug 2018 19:44:32 +0000 (21:44 +0200)]
base: register single precision conversions for types
We're already registering double versions, having single precision and
in practice possibly sufficient precision for commonly used conversions.
Øyvind Kolås [Mon, 27 Aug 2018 19:42:43 +0000 (21:42 +0200)]
tools/babl_fish_path_fitness: fix text only version
Øyvind Kolås [Sun, 26 Aug 2018 23:38:15 +0000 (01:38 +0200)]
tools: improve html output of babl_fish_path_fitness
Illustrate memory throughput as read+writte/time, providing a metric that
works for comparing conversions against each other on a single machine.
Øyvind Kolås [Sun, 26 Aug 2018 21:19:35 +0000 (23:19 +0200)]
babl: move BABL_ALPHA_FLOOR to public babl header
Øyvind Kolås [Sun, 26 Aug 2018 21:18:32 +0000 (23:18 +0200)]
extensions: handle negative premultiplied alpha
Øyvind Kolås [Sun, 26 Aug 2018 19:56:14 +0000 (21:56 +0200)]
babl: model-rgb handle negative alpha in premultiplied
Øyvind Kolås [Sun, 26 Aug 2018 19:52:01 +0000 (21:52 +0200)]
babl: model-rgb, handle negative alpha in premultiplied
Øyvind Kolås [Fri, 24 Aug 2018 23:09:49 +0000 (01:09 +0200)]
extensions: adapt to keep color in premultiplied alpha
Øyvind Kolås [Fri, 24 Aug 2018 17:16:34 +0000 (19:16 +0200)]
base: preserve color in premutiplied alpha
Alpha values below BABL_ALPHA_FLOOR gets stored in the components
as BABL_ALPHA_FLOOR with alpha also set to BABL_ALPHA_FLOOR,
recovery from pre-multiplied to non-premultiplied is done as normal.
BABL_FLOOR is set to be 1/65536.0 with a hope that this gives us
approximately 8bit of color data preserved when using half-float.
Upon encountering exactly BABL_ALPHA_FLOOR in premultiplied conversion
to non-premultiplied interprets this as 0.0, making pure 0.0 values
round trip correctly from RGBA to RaGaBaA back to RGBA.
This makes a lot of extensions invalid - as expected but it already
allows testing the behavior of GEGL and GIMP with this additional
feature from babl.
Øyvind Kolås [Tue, 21 Aug 2018 16:08:47 +0000 (18:08 +0200)]
babl: add performance flag to intent, issue #21
Add BABL_ICC_INTENT_PERFORMANCE which can be ored into the intente
num when requesting that babl constructs a space using
babl_space_from_icc, when PERFORMANCE is requested babl will permit
matrix+trc over cLUT, and when it is an intent without a performance
modifier this does not apply.
Øyvind Kolås [Tue, 21 Aug 2018 12:18:00 +0000 (14:18 +0200)]
icc: detect inconsistent Argyll ICC cLUT profiles, issue #21
The default behavior for Agryll when creating cLUT profiles seem to be
embedding an obviously incorrect XYZ matrix, meaning that for now we cannot use
the matrix for our relative colorimetric transform, and in the future the
profile will be incapable of doing dynamic trade-offs between performance and
accuracy by using matrix over cLUT during interactive operations.
We detect the swapped primaries in combination with presence of cLUTs and then
bail on constructing a valid babl space, as well as provide debug information
about why the profile cannot be used by babl.
Øyvind Kolås [Tue, 14 Aug 2018 16:30:51 +0000 (18:30 +0200)]
post release version bump
Øyvind Kolås [Tue, 14 Aug 2018 16:28:03 +0000 (18:28 +0200)]
release 0.1.56
Ell [Sat, 4 Aug 2018 06:18:37 +0000 (02:18 -0400)]
babl-cache: store reference fishes in the cache
When we only have a reference fish for a given conversion, and not
a path fish, store a corresponding entry in the cache, marked by a
"[reference]" tag in the fish's attributes line, and containing no
conversion list. When reloading the cache, make sure a reference
fish is created for the conversion without trying to construct a
path fish, so that we don't waste time trying to search for a
conversion path.
Note that we still show a "missing fast path" warning, even for
cached reference fishes.
Ell [Sat, 4 Aug 2018 06:14:29 +0000 (02:14 -0400)]
babl-cache: skip fishes with nonexistent conversions, instead of bailing
When encountering a nonexistent conversion while loading the fish
cache, skip the current fish, instead of stopping processing the
cache entirely.
Øyvind Kolås [Mon, 23 Jul 2018 02:18:08 +0000 (04:18 +0200)]
post release version bump
Øyvind Kolås [Mon, 23 Jul 2018 01:59:25 +0000 (03:59 +0200)]
release 0.1.54
Øyvind Kolås [Fri, 20 Jul 2018 16:08:15 +0000 (18:08 +0200)]
NEWS: update
Øyvind Kolås [Fri, 20 Jul 2018 15:34:42 +0000 (17:34 +0200)]
babl.h: tidy and update documentation
Jan Vesely [Fri, 20 Jul 2018 05:55:54 +0000 (01:55 -0400)]
meson: Generate babl.map based on export_symbols file
Fixing issue #20
Signed-off-by: Jan Vesely <jano.vesely@gmail.com>
Øyvind Kolås [Fri, 20 Jul 2018 14:27:55 +0000 (16:27 +0200)]
babl: use an existing const char ptr for encoding in format
Øyvind Kolås [Fri, 20 Jul 2018 14:14:18 +0000 (16:14 +0200)]
babl: add a new symbol babl_format_get_encoding
This returns the string passed in to babl_format_new - without the space
suffix that babl_get_name does for non-sRGB formats.
Øyvind Kolås [Wed, 18 Jul 2018 20:05:27 +0000 (22:05 +0200)]
babl: add babl_space_with_trc
Permitting to create variants of a space that shared the primaries
but use a different TRC function.
Debarshi Ray [Tue, 17 Jul 2018 12:09:31 +0000 (12:09 +0000)]
Add SSE2 versions of "Y float" and "YA float" to "CIE L float"
Øyvind Kolås [Mon, 16 Jul 2018 21:37:45 +0000 (23:37 +0200)]
babl: simplify babl_format_with_space
Rely on any format string containing the substring "-space" that this
substring is the marker for the end of the encoding part of the format
name - which is what we want replicated in our new format with a different
color space.
Øyvind Kolås [Mon, 16 Jul 2018 20:04:40 +0000 (22:04 +0200)]
babl: permit Babl * as first argument of babl_format_with_space
Øyvind Kolås [Mon, 16 Jul 2018 16:15:56 +0000 (18:15 +0200)]
babl: harmonize naming of space constructors
babl_icc_make_space remains for compatibility so older versions of gimp
do not get upset, the gimp-2.10 release depends on this symbol.
Øyvind Kolås [Thu, 12 Jul 2018 14:47:10 +0000 (16:47 +0200)]
babl: look deeper, and longer for path fishes
We now do two iterations of +1 and +2 path lengths that take much longer than
the configured path lengths - and now complain with a debug output listing the
set of conversions taken to satisfy the request - giving hints on what parts
could possibly be shortened to fewer steps.
With this commit the first level of searching deeper also gets a debug message
which would cause GIMP to print a message in some places where it earlier
wouldnt have warned about missing fast paths.
Øyvind Kolås [Thu, 12 Jul 2018 09:59:46 +0000 (11:59 +0200)]
babl: allow querying chromaticities for spaces made with matrix
Do this by computing the chromaticities coordinates of the colors
.. #ff0000 #00ff00 and #0000ff, this also harmonizes the serialized
name to always be chromaticities, white point and trcs.
Øyvind Kolås [Wed, 11 Jul 2018 23:24:42 +0000 (01:24 +0200)]
extensions/u32: add ~ model/format support
Øyvind Kolås [Wed, 11 Jul 2018 23:24:26 +0000 (01:24 +0200)]
extensions/u16; add ~ model/format support
Øyvind Kolås [Wed, 11 Jul 2018 23:22:35 +0000 (01:22 +0200)]
extensions/float: add ~ variants of conversions
Michael Natterer [Wed, 11 Jul 2018 21:57:40 +0000 (23:57 +0200)]
Change the license URL from gnu.org/licenses/ to https://
Øyvind Kolås [Wed, 11 Jul 2018 21:35:59 +0000 (23:35 +0200)]
babl: add babl_model_is, utility function for checking model equivalence
This creates an on the fly model with the same space as the one compared with
and does pointer equivalence. Using it makes for less verbose code.
Øyvind Kolås [Wed, 11 Jul 2018 21:23:08 +0000 (23:23 +0200)]
babl: make babl_model_with_space able to take format/model for space
Øyvind Kolås [Wed, 11 Jul 2018 20:57:59 +0000 (22:57 +0200)]
babl.h: add documentation
Øyvind Kolås [Wed, 11 Jul 2018 20:47:30 +0000 (22:47 +0200)]
babl: make equalize_matrix argument an enum
Øyvind Kolås [Wed, 11 Jul 2018 19:48:10 +0000 (21:48 +0200)]
babl: make babl_space_to_icc symbol internal
Øyvind Kolås [Wed, 11 Jul 2018 19:11:17 +0000 (21:11 +0200)]
babl-space: add comments, do not use a static temp struct
Øyvind Kolås [Wed, 11 Jul 2018 18:35:40 +0000 (20:35 +0200)]
babl: add babl_space_get_icc
Øyvind Kolås [Wed, 11 Jul 2018 18:35:37 +0000 (20:35 +0200)]
babl: simplify the singleton logic in babl_format_with_space
Øyvind Kolås [Wed, 11 Jul 2018 15:07:52 +0000 (17:07 +0200)]
babl: export symbol model_with_space
Øyvind Kolås [Mon, 9 Jul 2018 20:58:55 +0000 (22:58 +0200)]
babl: add babl_space_get
An accessor for getting back out the chromaticities of whitepoint and primaries
as well as trcs.
Øyvind Kolås [Mon, 9 Jul 2018 14:48:05 +0000 (16:48 +0200)]
babl: add separate LUTs for rTRC,gTRC and bTRC in generic fast paths
Øyvind Kolås [Mon, 9 Jul 2018 14:29:42 +0000 (16:29 +0200)]
babl: fix bug in icc tag alignment
Øyvind Kolås [Sun, 8 Jul 2018 20:38:25 +0000 (22:38 +0200)]
babl: export symbol babl_space_to_icc
Øyvind Kolås [Sun, 8 Jul 2018 13:54:58 +0000 (15:54 +0200)]
babl: export more symbols
Adding babl_chromaticities_make_space, babl_trc and
babl_trc_gamma to public api and ability to setup arbitrary
BablSpaces without loading from ICC profiles.
Øyvind Kolås [Sat, 7 Jul 2018 20:46:50 +0000 (22:46 +0200)]
extensions/two-table: temporarily disable
When viewing PNGs with attached ICC profiles the gegl binary produces black
if the two-table extension is active. Something is wrong in babl even accepting
these paths.
Andrea Veri [Tue, 3 Jul 2018 09:58:13 +0000 (09:58 +0000)]
Drop newlines between tags
Øyvind Kolås [Mon, 2 Jul 2018 14:03:43 +0000 (16:03 +0200)]
post-release version bump
Øyvind Kolås [Mon, 2 Jul 2018 13:42:15 +0000 (15:42 +0200)]
release 0.1.52
Øyvind Kolås [Mon, 2 Jul 2018 13:41:59 +0000 (15:41 +0200)]
export-symbols: export babl_trc
Øyvind Kolås [Mon, 2 Jul 2018 13:41:01 +0000 (15:41 +0200)]
NEWS: update
Ell [Mon, 25 Jun 2018 13:29:08 +0000 (09:29 -0400)]
babl-palette: fix default palette double-data size
Øyvind Kolås [Sun, 24 Jun 2018 09:56:18 +0000 (11:56 +0200)]
babl: fix trc registrationof ACES spaces
Øyvind Kolås [Sat, 23 Jun 2018 20:32:20 +0000 (22:32 +0200)]
babl: predefine ACEScg and ACES2065-1 BablSpaces
Øyvind Kolås [Thu, 21 Jun 2018 12:49:12 +0000 (14:49 +0200)]
tests: add format_with_space test
Testing that both R'G'B' formats and CIE Lab float keep the space they have
been created with.
Øyvind Kolås [Wed, 20 Jun 2018 19:04:46 +0000 (21:04 +0200)]
babl: refactor format registration to loop over types
Also register full set of R~G~B~ and Y~ formats for all the types.
Øyvind Kolås [Wed, 20 Jun 2018 18:43:53 +0000 (20:43 +0200)]
babl: add ~ variants to gray color models
We do not add premultiplied sRGB trc variants even if this exists for RGB
since it is the type of premultiplied alpha cairo expects. The less code
that does non-linear compositing the better, excluding some possibilities
also reduces the combinatorial overhead of finding conversion paths in babl.
Øyvind Kolås [Wed, 20 Jun 2018 10:33:28 +0000 (12:33 +0200)]
babl: add R~G~B~ color models and pixel formats
From a given BablSpace which defines RGB chromaticities and
per component TRCs, the following are the defined formats:
R'G'B' with the TRCs applied
RGB linear data
and now a new one
R~G~B~ with the sRGB TRC, this permits any BablSpace to be the
native format of a buffer in an application while having both
a 'perceptual' in R~G~B~ and linear in RGB that is possible
to derive from it. Importantly it is also possible to recover
the babl space used to create the buffer.
Øyvind Kolås [Wed, 20 Jun 2018 17:35:43 +0000 (19:35 +0200)]
babl: clarify internal gray babl-id enums
Use GRAY_LINEAR and GRAY_NONLINEAR making the introduction of PERCEPTUAL
easier.
Øyvind Kolås [Wed, 20 Jun 2018 10:55:55 +0000 (12:55 +0200)]
babl: remove outdated comment
Øyvind Kolås [Tue, 19 Jun 2018 17:29:48 +0000 (19:29 +0200)]
babl: rename functions that used to refer to specific gamma
The definitions of components and formats for linear and nonlinear formats in
model-rgb and model-gray are now using the TRC of a BablSpace, thus in the
format syntax ' now means nonlinear, not sRGB / 2.2 gamma - even though it ends
up meaning that for formats create without specifying the space.
Ell [Thu, 14 Jun 2018 06:16:08 +0000 (02:16 -0400)]
babl-palette: warn when trying to create a palette with > 256 colors
... and only use the first 256 colors.
Ell [Thu, 14 Jun 2018 05:54:52 +0000 (01:54 -0400)]
babl-fish: fix concurrent babl_fish()/process() calls with palette formats
In babl_fish(), don't call _babl_fish_rig_dispatch() on existing
path fishes during each lookup. We already call this function on
all path fishes upon creation (in particular, after commit
b34a9672c8c9a42923a8f0b2650af30b1efe635c), so this isn't necessary.
This fixes an issue where the _babl_fish_rig_dispatch() call in
babl_fish() would temporarily modify the value of babl->fish.data,
causing a concurrent babl_process[_rows]() call in another thread
to pass the wrong 'data' value down to the conversion function. In
particular, this could cause palette conversions to segfault.
Elle Stone [Sat, 9 Jun 2018 17:18:43 +0000 (19:18 +0200)]
babl: fix fixed to double conversions
See issue #18 https://gitlab.gnome.org/GNOME/babl/issues/18
Øyvind Kolås [Sat, 9 Jun 2018 17:11:26 +0000 (19:11 +0200)]
babl-space: babl_space_new_from_chromaticities add equalize_matrix argument
Part of the problem in issue #18
This API is internal only for now so we can change it, changing to use a
hard-coded pre-quantized chromaticities set for the internal sRGB space.
This preserve the gray axis matrix equalization performed for other spaces used
with babl, ideally we can improve the gray-axis equalization to match and
return to using it also for sRGB.
Ell [Wed, 30 May 2018 10:01:27 +0000 (06:01 -0400)]
babl-palette: warn when trying to create a 0-color palette
In babl_palette_set_palette(), fall back to the default palette,
and log a warning, when trying to create a palette with < 1 colors.
Ell [Wed, 30 May 2018 09:45:17 +0000 (05:45 -0400)]
babl-memory: allow babl_malloc(0) to succeed
Allow a babl_malloc() call with size == 0 to succeed, returning a
dummy allocation, instead of asserting on this condition. The new
babl-palette code tries to allocate an empty buffer for the radii
array when creating a single-color palette, which would previously
lead to a crash.
Ell [Fri, 25 May 2018 12:52:47 +0000 (08:52 -0400)]
babl-palette: fix default-palette radii array size
Ell [Thu, 24 May 2018 14:55:17 +0000 (10:55 -0400)]
babl-palette: make default palette initialization thread-safe
... and allocate its radii statically.
Øyvind Kolås [Sun, 20 May 2018 08:49:52 +0000 (10:49 +0200)]
post release version bump
Øyvind Kolås [Sun, 20 May 2018 08:45:46 +0000 (10:45 +0200)]
release 0.1.50
Edward E [Sun, 1 Apr 2018 06:23:45 +0000 (01:23 -0500)]
Fix an unimportant typo
What's in a name? S.E.P.
Ell [Sat, 19 May 2018 12:28:19 +0000 (08:28 -0400)]
tests: fix palette-concurrency-stress-test
Fix palette-concurrency-stress-test to accommodate the change to a
gamma-corrected 8-bit format (commit
fabcc6729ed453fb5c5affc565d0e837a78afc5c), and to little-endian
hash indices (commit
55ca45c8233af138d3fd388587b203d802b8396c).
The test should pass regardless, it simply didn't actually test for
the intended issue previously.
Øyvind Kolås [Sat, 19 May 2018 11:35:04 +0000 (13:35 +0200)]
tools: code around gcc warning about 0 length format string
John Marshall [Sat, 19 May 2018 11:08:12 +0000 (12:08 +0100)]
Meson build: fixes for windows build
John Marshall [Sat, 19 May 2018 10:53:51 +0000 (11:53 +0100)]
Meson build: generate png image files for docs
John Marshall [Sat, 19 May 2018 10:51:30 +0000 (11:51 +0100)]
Meson build: Improve git-version.h generation
John Marshall [Sat, 19 May 2018 10:48:26 +0000 (11:48 +0100)]
Meson build: Tidy up code and improve readability
John Marshall [Sat, 19 May 2018 10:38:18 +0000 (11:38 +0100)]
Meson build: improve doc generation
John Marshall [Sat, 19 May 2018 10:36:45 +0000 (11:36 +0100)]
Meson build: Improve host environment detection / handling
John Marshall [Sat, 19 May 2018 10:01:46 +0000 (11:01 +0100)]
Meson build: Improve SIMD assembly checking/use
Ell [Fri, 18 May 2018 13:01:26 +0000 (09:01 -0400)]
babl-palette: initialize radii of default palette
... to prevent a segfault when using the default palette, namely,
in tests/palette.
Ell [Fri, 18 May 2018 12:04:52 +0000 (08:04 -0400)]
babl-palette: speed up closest-color search
When constructing a palette format, calculate the distance between
each pair of colors in the palette, and for each color, construct a
list of all other colors and their distances from it, sorted by
distance. When searching for the closest palette color to a given
input pixel, based on the assumption that nearby pixels have
similar color, use the color list of the previous pixel's best
match, and use the triangle inequality to stop the search early.
See the code comments for more details.
Øyvind Kolås [Fri, 18 May 2018 09:02:04 +0000 (11:02 +0200)]
babl: use hashtable approach in double reference
Strictly speaking we should be doing the reference using
conversions to R'G'B'A double and using the distance metric
there; possibly getting a slight difference in result at
comparison ties.
In use GEGL ends up using both the really fast 8bit code paths
and the quite fast floating point code paths that use 8bit
hashtables for the lookup of conversion.
Progress on bug #787237 missing fast-paths.
Øyvind Kolås [Thu, 17 May 2018 14:24:49 +0000 (16:24 +0200)]
babl-palette: fix regression in prefvious commit
The 255.5 factor for storing a double represenation is neccesary for
desired behavior.
Øyvind Kolås [Thu, 17 May 2018 12:33:07 +0000 (14:33 +0200)]
babl-palette: improvements toward palette accuracy
For working at acceptable performance with large indexed images, it is
recommended to run with BABL_TOLERANCE=0.0385 or highger set in the environment
when launching GIMP, this permits using a hashtable based optimization that
still isn't accurate enough according to babl-expectations.
Part of progress on bug 787237
Øyvind Kolås [Thu, 17 May 2018 10:53:42 +0000 (12:53 +0200)]
meson.build: synchronise with autotools version
WARNING: distributions should still not use meson to build packages - since
the meson build end up containing all instructions available on build host.
Jan Vesely [Thu, 17 May 2018 04:04:04 +0000 (00:04 -0400)]
meson.build: Bump version to 0.1.48
Signed-off-by: Jan Vesely <jano.vesely@gmail.com>
Øyvind Kolås [Wed, 16 May 2018 11:13:26 +0000 (13:13 +0200)]
babl: preliminary work to add float fast path to palette formats
Still not accurate enough to be acceptable, gets accepted by system with
a BABL_TOLERANCe of 0.045 or higher. Needs more work.
Øyvind Kolås [Tue, 15 May 2018 19:29:56 +0000 (21:29 +0200)]
post release version bump
Øyvind Kolås [Tue, 15 May 2018 19:28:11 +0000 (21:28 +0200)]
release 0.1.48
Øyvind Kolås [Tue, 15 May 2018 19:06:16 +0000 (21:06 +0200)]
configure: try to add -Ofast to CFLAGS
Debarshi Ray [Mon, 14 May 2018 14:04:27 +0000 (16:04 +0200)]
Debarshi Ray [Mon, 14 May 2018 09:24:27 +0000 (11:24 +0200)]
CIE: Add an SSE2 version of "RGBA float" to "CIE L float"
On an Intel i7 Haswell, it now takes 0.056s to convert a 15 megapixel
buffer from "RGBA float" to "CIE L float" instead of the earlier
0.107s.
https://bugzilla.gnome.org/show_bug.cgi?id=795686
Debarshi Ray [Sat, 28 Apr 2018 23:15:46 +0000 (01:15 +0200)]
CIE: Add an SSE2 version of "RGBA float" to "CIE Lab alpha float"
On an Intel i7 Haswell, it now takes 0.13s to convert a 15 megapixel
buffer from "RGBA float" to "CIE Lab alpha float" instead of the
earlier 0.27s.
SSEx doesn't have integer multiplication or division operations, and
using bit shifts to implement integer divisions by powers of 2 seems to
introduce errors. Therefore, it was problematic to use the cube root
approximation from Hacker's Delight, which uses quite a few integer
divisions to make the initial guess. Instead, Halley's method of
approximating the cube root seems more SSEx friendly because the
initial guess requires only one integer division, which we can manage
by jumping through a relatively small number of hoops.
The scalar version of Halley's method seems to have originated from
http://metamerist.com/cbrt/cbrt.htm but that's not accessible anymore.
At present there's a copy in CubeRoot.cpp in the Skia sources that's
licensed under a BSD-style license. There's some discussion on the
implementation at http://www.voidcn.com/article/p-gpwztojr-wt.html.
Note that Darktable also has an SSE2 version of the same algorithm,
but uses only a single iteration of Halley's method, which is too
coarse.
Here's some more discussion on the cube root approximation algorithms:
https://bugzilla.gnome.org/show_bug.cgi?id=791837
https://bugzilla.gnome.org/show_bug.cgi?id=795686
Debarshi Ray [Sun, 29 Apr 2018 21:57:42 +0000 (23:57 +0200)]
build: Add scaffolding for SSE3
It's currently unused, but is useful to have it around when comparing
different vectorization strategies.
https://bugzilla.gnome.org/show_bug.cgi?id=795686
Debarshi Ray [Sat, 28 Apr 2018 22:21:44 +0000 (00:21 +0200)]
CIE: Make the XYZ to LAB code look similar to the RGB to LAB code
Such superficial differences make the code harder to scan when looking
for bugs and optimization opportunities.